package eg.backend.manager;

import java.util.Date;
import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import eg.backend.domain.Dimension;
import eg.backend.domain.Expense;
import eg.backend.domain.fly.AggregatedRecord;
import eg.backend.domain.fly.TagCount;
import eg.backend.query.QueryDefinition;

@Transactional(propagation = Propagation.SUPPORTS)
public interface ExpenseManager {
	List<Expense> findDailyExpense(Date date);
		
	List<Expense> findDetailByQueryDefinition(QueryDefinition queryDefinition);
	List<AggregatedRecord> findByQueryDefinition(QueryDefinition queryDefinition);
	
	/* end of finder */
	
	List<Expense> update(List<Expense> toUpdate, List<Expense> toDelete);

	void deleteSingle(String id);
		
	List<String> findTagNames(String query);
	
	List<TagCount> findUsedTags();

	List<String> findShopNames(String query);
	
	List<TagCount> findUsedShops();
	
	//
	String getEffectiveParent(Dimension oldChild, List<String> deletedList);
	void addDimension2Expense(String expense, String dimension);
	List<String> findChildrenIdsByDimension(String dimension);
	
}
